export default defineNitroPlugin((nitroApp) => {
    // console.log(import.meta.env.NODE_ENV)
    nitroApp.hooks.hook('render:html', (ctx, { event }) => {
        const userAgent = event.headers.get('user-agent')!
        const isNotInPC = /iPad|iPhone|Android/i.test(userAgent);
        if (isNotInPC) {
            ctx.head.unshift(`
                <script src="//cdn.jsdelivr.net/npm/eruda"></script>
                <script src="//cdn.jsdelivr.net/npm/eruda-code"></script>
                <script>
                    eruda.init();
                    eruda.add(erudaCode).show('code');
                    eruda.show('console');
                </script>
            `)
        }
    })
});
